home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_06
/
8n06026a
< prev
next >
Wrap
Text File
|
1990-04-16
|
612b
|
42 lines
*****Listing 3*****
#include <stdio.h>
#include <stdlib.h>
#define SET 1
#define CLEAR 0
void eh(void);
struct status_flags {
unsigned f0 : 1;
unsigned f1 : 1;
unsigned f2 : 1;
unsigned f3 : 1;
} flags = {
CLEAR, CLEAR, CLEAR, CLEAR
};
main()
{
atexit(eh);
flags.f2 = 1;
flags.f3 = 1;
}
void eh(void)
{
if (flags.f0 == SET)
printf("f0 needs cleanup\n");
if (flags.f1 == SET)
printf("f1 needs cleanup\n");
if (flags.f2 == SET)
printf("f2 needs cleanup\n");
if (flags.f3 == SET)
printf("f3 needs cleanup\n");
}
f2 needs cleanup
f3 needs cleanup